package com.yj.springbootdynamic.service;

import com.yj.springbootdynamic.config.DataSourceSwitch;
import com.yj.springbootdynamic.entity.User;
import com.yj.springbootdynamic.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {


    @Autowired
    UserMapper userMapper;

    @DataSourceSwitch(value = "slaver",clear = false)
    public List<User> findAll(){
        return userMapper.findAll();
    }
    public List<User> findAll2(){
        return userMapper.findAll();
    }
}
